<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="my.dao.*" %>
    
<%
	//request代表了手机端发来的请求数据
	String u_id = request.getParameter("u_id");
	String u_pwd = request.getParameter("u_pwd");
	
	String sql ="select count(*) from t_user where  u_id = ? and u_pwd = ?";
	int cnt = MyDao.queryInteger(sql, u_id,u_pwd);
	
	if(cnt > 0){
		//登录成功
		//session即服务器上的一个对象，用于唯一对应一个客户端
		
		session.setAttribute("USERID", u_id);
		String result = MyDao.jsonResult(true, "登录成功!");
		
		out.print(result);
	}else{
		String result = MyDao.jsonResult(false, "账户或密码错误!");
		
		out.print(result);
	}
	
	
	

%>    













